<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">SMO</b>
<td valign="baseline" align="right" class="function"><a href="../svm/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>Sequential Minimal Optimization for binary SVM with L1-soft margin.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;smo(&nbsp;data&nbsp;)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;smo(&nbsp;data,&nbsp;options&nbsp;)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;smo(&nbsp;data,&nbsp;options,&nbsp;init_model)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;is&nbsp;implementation&nbsp;of&nbsp;the&nbsp;Sequential&nbsp;Minimal&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;Optimizer&nbsp;(SMO)&nbsp;[<a href="../references.html#Platt98" title = "J.C.Platt. Sequential minimal optimizer: A fast algorithm for training support vector machines. Technical Report MSR-TR-98-14, Microsoft Research, Redmond, 1998. http://www.research.microsoft.com/~jplatt/smo.html." >Platt98</a>]&nbsp;to&nbsp;train&nbsp;the&nbsp;binary&nbsp;Support&nbsp;Vector&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;Machines&nbsp;Classifier&nbsp;with&nbsp;L1-soft&nbsp;margin.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;[struct]&nbsp;Binary&nbsp;labeled&nbsp;training&nbsp;vectors:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Training&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.y&nbsp;[a&nbsp;x&nbsp;num_data]&nbsp;Labels&nbsp;(1&nbsp;or&nbsp;2).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;options&nbsp;[struct]&nbsp;Control&nbsp;parameters:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.ker&nbsp;[string]&nbsp;Kernel&nbsp;identifier&nbsp;(default&nbsp;'linear');&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;'help&nbsp;kernel'for&nbsp;more&nbsp;info.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.arg&nbsp;[1&nbsp;x&nbsp;nargs]&nbsp;Kernel&nbsp;argument(s)&nbsp;(default&nbsp;1).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.C&nbsp;Regularization&nbsp;constant&nbsp;(default&nbsp;C=inf).&nbsp;The&nbsp;constant&nbsp;C&nbsp;can&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;given&nbsp;as:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;[1x1]&nbsp;..&nbsp;for&nbsp;all&nbsp;data.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;[1x2]&nbsp;..&nbsp;for&nbsp;each&nbsp;class&nbsp;separately&nbsp;C=[C1,C2].</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;[1xnum_data]&nbsp;..&nbsp;for&nbsp;each&nbsp;training&nbsp;vector&nbsp;separately.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.eps&nbsp;[1x1]&nbsp;SMO&nbsp;paramater&nbsp;(default&nbsp;0.001).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.tol&nbsp;[1x1]&nbsp;Tolerance&nbsp;of&nbsp;KKT-conditions&nbsp;(default&nbsp;0.001).</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;init_model&nbsp;[struct]&nbsp;Specifies&nbsp;initial&nbsp;model:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[num_data&nbsp;x&nbsp;1]&nbsp;Initial&nbsp;model.&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[1x1]&nbsp;Bias.</span><br>
<span class=help>&nbsp;&nbsp;If&nbsp;not&nbsp;given&nbsp;then&nbsp;it&nbsp;is&nbsp;set&nbsp;to&nbsp;zero&nbsp;by&nbsp;default.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Binary&nbsp;SVM&nbsp;classifier:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[nsv&nbsp;x&nbsp;1]&nbsp;Weights&nbsp;(Lagrangians).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[1x1]&nbsp;Bias.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.sv.X&nbsp;[dim&nbsp;x&nbsp;nsv]&nbsp;Support&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.nsv&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;Support&nbsp;Vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.kercnt&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;kernel&nbsp;evaluations&nbsp;used&nbsp;by&nbsp;SMO.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.trnerr&nbsp;[1x1]&nbsp;Training&nbsp;classification&nbsp;error.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.margin&nbsp;[1x1]&nbsp;Margin&nbsp;of&nbsp;the&nbsp;found&nbsp;classifier.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.cputime&nbsp;[1x1]&nbsp;Used&nbsp;CPU&nbsp;time&nbsp;in&nbsp;seconds.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.options&nbsp;[struct]&nbsp;Copy&nbsp;of&nbsp;used&nbsp;options.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;trn&nbsp;=&nbsp;load('riply_trn');&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;smo(trn,struct('ker','rbf','C',10,'arg',1));</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;ppatterns(trn);&nbsp;psvm(model);&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;tst&nbsp;=&nbsp;load('riply_tst');</span><br>
<span class=help>&nbsp;&nbsp;ypred&nbsp;=&nbsp;svmclass(&nbsp;tst.X,&nbsp;model&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;cerror(&nbsp;ypred,&nbsp;tst.y&nbsp;)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../svm/svmclass.html" target="mdsbody">SVMCLASS</a>,&nbsp;<a href = "../svm/svmlight.html" target="mdsbody">SVMLIGHT</a>,&nbsp;<a href = "../svm/svmquadprog.html" target="mdsbody">SVMQUADPROG</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../svm/list/smo.html">smo.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 23-may-2004, VF<br>
 17-September-2001, V. Franc, created<br>

</body>
</html>
